import { createRouter, createWebHistory } from 'vue-router';
const baseUrl = import.meta.env.VITE_APP_CONTEXT_PATH;

const router = createRouter({
    history: createWebHistory(baseUrl),
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            meta: {
                title: '佑恩咨询'
            },
            component: () => import('@/pages/home.vue')
        },
        {
            path: '/about',
            meta: {
                title: '关于我们'
            },
            component: () => import('@/pages/about.vue')
        },
        {
            path: '/detail',
            meta: {
                title: '选择我们'
            },
            component: () => import('@/pages/detail.vue')
        },
        {
            path: '/category',
            meta: {
                title: '行业领域'
            },
            component: () => import('@/pages/category.vue')
        },
        {
            path: '/connect',
            meta: {
                title: '联系我们'
            },
            component: () => import('@/pages/connect.vue')
        },
        {
            path: '/news',
            meta: {
                title: '新闻中心'
            },
            component: () => import('@/pages/news.vue')
        },
        {
            path: '/newsDetail',
            meta: {
                title: '新闻详情'
            },
            component: () => import('@/pages/newsDetail.vue')
        },
        {
            path: '/404',
            meta: {
                title: '访问错误'
            },
            component: () => import('@/pages/404.vue')
        },
        {
            path: '/:catchAll(.*)',
            component: () => import('@/pages/404.vue')
        }
    ]
});

export default router;
